package com.ewanghuiju.app.pay;

import android.app.Activity;

import com.ewanghuiju.app.model.bean.local.WxPayBean;
import com.google.gson.Gson;

public class PayUtils {
    public static void request(Activity context, int type, String jsPayDataBean) {

        if (type == 1) {
            Gson gson = new Gson();
            WxPayBean wxPayBean = gson.fromJson(jsPayDataBean, WxPayBean.class);
            WXPay.wxPay(context, wxPayBean);
        } else if (type == 2) {
            AliPay aliPay = new AliPay(context);

            jsPayDataBean = jsPayDataBean.replaceAll("%26", "&");
            aliPay.pay(jsPayDataBean);
        }
    }

}
